<?php
/**
 * The following variables are available in this template:
 * - $this: the BootCrudCode object
 */
?>
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'".$this->class2id($this->modelClass)."-form',
    'enableAjaxValidation'=>false,
)); ?>\n"; ?>

    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php echo "<?php echo \$form->errorSummary(\$model); ?>\n"; ?>

<?php
foreach($this->tableSchema->columns as $column)
{
    if($column->autoIncrement) {
        continue;
    }else {
        switch ($column->name) {
            case 'active':
                echo "\t<?php if(!\$model->isNewRecord) {\n";
                echo "\t\techo \$form->checkboxRow(\$model, 'active');\n";
                echo "\t} ?>\n";
                break;
            case 'delmark';
            case 'created_date';
            case 'updated_date';
                break;
            default:
                echo "\t<?php echo ".$this->generateActiveRow($this->modelClass,$column)."; ?>\n";
        }
    }
}
?>
    <div class="form-actions">
        <?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'submit',
            'type'=>'primary',
            'label'=>\$model->isNewRecord ? 'Create' : 'Save',
        )); ?>\n"; ?>
    </div>

<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
